<?php

namespace ApiBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Admin
 *
 * @ORM\Table(name="admin", options={"comment":"Admin表"})
 * @ORM\Entity()
 */
class Admin
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="smallint")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var \ApiBundle\Entity\Admin
     *
     * @ORM\ManyToOne(targetEntity="ApiBundle\Entity\Admin")
     * @ORM\JoinColumn(name="parent_id", referencedColumnName="id")
     */
    private $parent;

    /**
     * @ORM\ManyToOne(targetEntity="ApiBundle\Entity\District")
     * @ORM\JoinColumn(name="district_id", referencedColumnName="id", nullable=true)
     */
    private $district;

    /**
     * @ORM\ManyToOne(targetEntity="ApiBundle\Entity\AdminRole")
     * @ORM\JoinColumn(name="admin_role_id", referencedColumnName="id", nullable=true)
     */
    private $adminRole;

    /**
     * @var string
     *
     * @ORM\Column(name="phone", type="string", length=11,  options={"default":"", "comment":"手机号码"})
     */
    private $phone;

    /**
     * @var string
     *
     * @ORM\Column(name="nickname", type="string", length=16, options={"default":"", "comment":"昵称"})
     */
    private $nickname;

    /**
     * @var string
     *
     * @ORM\Column(name="realname", type="string", length=16, options={"default":"", "comment":"姓名"})
     */
    private $realname;

    /**
     * @var string
     *
     * @ORM\Column(name="email", type="string", length=50, nullable=true, options={"default":"", "comment":"email"})
     */
    private $email;

    /**
     * @var string
     *
     * @ORM\Column(name="token", type="string", length=40, nullable=true, options={"comment":"小程序token"})
     */
    private $token;

    /**
     * @var string
     *
     * @ORM\Column(name="salt", type="string", length=6, options={"comment":"盐值"})
     */
    private $salt;

    /**
     * @var string
     *
     * @ORM\Column(name="password", type="string", length=40, nullable=true, options={"comment":"sha1(md5($password) . $salt)"})
     */
    private $password;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="created_at", type="datetime", options={"comment":"创建时间"})
     */
    private $createdAt;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"更新时间"})
     */
    private $updatedAt;

    /**
     * @var bool
     *
     * @ORM\Column(name="status", type="boolean", options={"default":1, "comment":"状态 1启用 0禁用"})
     */
    private $status;

}

